﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width" />
    <script src="/js/header.js"></script>
</head>
<body>
    <div class="data-wrap case">
        <div class="data-tool clearfix">
            <div class="pull-left form-inline ">
                <a class="btn btn-default" data-modal="/view/role/add.html" data-title="创建用户" data-width="452" data-height="300"><span class="glyphicon glyphicon-plus"></span>创建用户</a>
            </div>
            <div class="pull-right">
                <form class="form-inline" id="formSearch">
                    <label class="m15_l">名称</label>

                    <input class="form-control" name="rName" type="text" value="">
                    <button type="button" class="btn btn-default m5_l" id="btnSearch"><span class="glyphicon glyphicon-search"></span>搜索</button>
                </form>
            </div>
        </div>
        <div class="paging">
        </div>

    </div>
    <script type="text/x-dot-template" id="templatePager">
        <div class="data-head table-responsive">
            <table class="table">
                <thead>
                    <tr>
                        <th class="t_l">所属公司</th>
                        <th width="200" class="t_l">角色名称</th>
                        <th width="100">状态</th>
                        <th width="130">操作</th>
                    </tr>
                </thead>
            </table>
        </div>

        <div class="data-body data-scroll">
            <div class="data-div-view">
                <table class="table table-hover">
                    <tbody>
                        {{~it.tData :item:index}}
                        <tr>
                            <td class="t_l">{{? item.companyResponse!=null }}{{= item.companyResponse.companyName }}{{??}}{{?}}</td>
                            <td width="200" class="t_l">{{= item.rName }}</td>
                            <td width="100">
                                {{? item.rStatus==1 }}
                                显示
                                {{?? }}
                                隐藏
                                {{? }}
                            </td>
                            <td width="130">
                                {{? item.rStatus==1 }}
                                <a class="btn btn-danger" data-confirm="确定要隐藏该角色？" data-href="/Role/UpdateStatus?id={{= item.rId}}&status=2">隐藏</a>
                                {{?? }}
                                <a class="btn btn-primary" data-confirm="确定要显示该角色？" data-href="/Role/UpdateStatus?id={{= item.rId}}&status=1">显示</a>
                                {{? }}
                                <button type="button" class="btn btn-default" data-modal="/view/role/edit.html?id={{= item.rId}}" data-title="编辑角色信息" data-width="452" data-height="300">
                                    <span class="glyphicon glyphicon-edit"></span> 编辑
                                </button>
                            </td>
                        </tr>
                        {{~}}
                    </tbody>
                </table>
            </div>
        </div>
        <!-- 必要的分页参数设置 -->
        <input type="hidden" id="TotalCount" value="{{=it.totalCount}}" />
    </script>
    <script type="text/javascript">
        //菜单状态
        var menuStatus ={
            show: 1,
            hide: 2
        };

        $(function () {
            FlashPay.UI.DoSearch();

            $("#btnSearch").click(function () {
                window.currentPage = null;
                doSearch();
            });
        });

        $(document).keyup(function (event) {
            var keycode = event.which;
            if (keycode == 13) {
                FlashPay.UI.DoSearch();
            }
        }); 

        function Tip_success(word) {
            FlashPay.UI.Tip_success(word);
        }

        function doSearch() {
            FlashPay.UI.Pager(".paging", { templateId:"templatePager",ajax: { url: '/user/GetPager'} });
        }
    </script>
</body>
</html>